package com.glsc.ngateway.common.base.domain.mysql.gateway.other;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author weizt
 * @date 2023/05/08
 * 自有资金交易账户开立、变更、注销流程所有信息
 */
@Data
@Entity
@Table(name = "t_gw_trade_account_history")
@org.hibernate.annotations.Table(appliesTo = "t_gw_trade_account_history",comment = "自有资金交易账户开立、变更、注销流程所有信息")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class TradeAccountHistory {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column(name = "title" , columnDefinition = "varchar(255)")
    private String title;

    @Column(name = "creater" , columnDefinition = "varchar(255)")
    private String creater;

    @Column(name = "applicant" , columnDefinition = "varchar(255)")
    private String applicant;

    @Column(name = "applicant_depart" , columnDefinition = "varchar(255)")
    private String applicantDepart;

    @Column(name = "applicant_comp", columnDefinition = "varchar(255)")
    private String applicantComp;

    @Column(name = "apply_date", columnDefinition = "varchar(255)")
    private String applyDate;

    @Column(name = "business_type", columnDefinition = "varchar(255)")
    private String businessType;

    @Column(name = "account_name", columnDefinition = "varchar(255)")
    private String accountName;

    @Column(name = "account_number", columnDefinition = "varchar(255)")
    private String accountNumber;

    @Column(name = "account_setup_org", columnDefinition = "varchar(255)")
    private String accountSetupOrg;

    @Column(name = "account_type", columnDefinition = "varchar(255)")
    private String accountType;

    @Column(name = "apply_explain", columnDefinition = "varchar(255)")
    private String applyExplain;

    @Column(name = "remark", columnDefinition = "varchar(255)")
    private String remark;

    @Column(name = "appendix_explain", columnDefinition = "varchar(255)")
    private String appendixExplain;

    @Column(name = "appendix", columnDefinition = "varchar(255)")
    private String appendix;

    @Column(name = "apply_result", columnDefinition = "varchar(255)")
    private String applyResult;

    @Column(name = "appendix_explain2", columnDefinition = "varchar(255)")
    private String appendixExplain2;

    @Column(name = "appendix2", columnDefinition = "varchar(255)")
    private String appendix2;

    @Column(name = "workflow_id", columnDefinition = "varchar(255)")
    private String workflowId;

    @Column(name = "request_id", columnDefinition = "varchar(255)")
    private String requestId;

    @Column(name = "flow_node_code", columnDefinition = "varchar(255)")
    private Integer flowNodeCode;

    @Column(name = "workflow_name", columnDefinition = "varchar(255)")
    private String workflowName;

    @Column(name = "flow_node", columnDefinition = "varchar(255)")
    private String flowNode;

    @Column(name = "flow_status_type", columnDefinition = "varchar(255)")
    private String flowStatusType;

    @Column(name = "apply_number", columnDefinition = "varchar(255)")
    private String applyNumber;

    @Column(name = "applicant_account", columnDefinition = "varchar(255)")
    private String applicantAccount;

    @Column(name = "account_setup_org_code", columnDefinition = "varchar(255)")
    private String accountSetupOrgCode;

    @Column(name = "applicant_depart_id", columnDefinition = "varchar(255)")
    private String applicantDepartId;

    @Column(name = "applicant_comp_id", columnDefinition = "varchar(255)")
    private String applicantCompId;

    @Column(name = "account_type_code", columnDefinition = "varchar(255)")
    private String accountTypeCode;

    @Column(name = "business_type_code", columnDefinition = "varchar(255)")
    private String businessTypeCode;

    @Column(name = "share_holder_list_string", columnDefinition = "text COMMENT '多条股东信息'")
    private String shareHolderListString;

    @Transient
    private List<TradeAccountShareHolder> shareHolderList;

    @Transient
    private List<TradeAccountFurture> furtureList;

    @Transient
    private List<TradeAccountOwnFund> ownFundList;

    @Transient
    private List<TradeAccountSaleFund> saleFundList;

    @Column(name = "own_fund_list_string", columnDefinition = "text COMMENT '多条自营基金信息'")
    private String ownFundListString;

    @Column(name = "sale_fund_list_string", columnDefinition = "text COMMENT '多条代销基金信息'")
    private String saleFundListString;

    @Column(name = "future_list_string" , columnDefinition = "text COMMENT '多条期货信息'")
    private String furtureListString;

    @Column(name = "insert_time", columnDefinition = "datetime comment '创建时间'")
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime insertTime;

    @Column(name = "update_time", columnDefinition = "datetime comment '更新时间'")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime updateTime;

}

